package com.ds.lens.data.common.umpapi;

import lombok.Getter;

import java.util.HashMap;
import java.util.Map;

/**
 * Description:
 *
 * @author WeiShaoying
 * @date 2019-12-23
 */
public enum UmpResultTypeEnum {

    MATRIX("matrix"),
    VECTOR("vector"),
    SCALAR("scalar"),
    STRING("string");

    @Getter
    private String resultType;

    UmpResultTypeEnum(String resultType) {
        this.resultType = resultType;
    }

    private static Map<String, UmpResultTypeEnum> enumHashMap = new HashMap<>();

    static {
        for (UmpResultTypeEnum typeEnum : UmpResultTypeEnum.values()) {
            enumHashMap.put(typeEnum.resultType, typeEnum);
        }
    }

    public static UmpResultTypeEnum enumOf(String desc) {
        return enumHashMap.get(desc);
    }

}
